#ifndef __FTP_CILENT_H__
#define __FTP_CILENT_H__

#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdbool.h>
#include "protocol.h"

// 定义颜色代码
#define RED 	"\033[31m"
#define GREEN   "\033[32m"
#define BLUE    "\033[34m"
#define RESET   "\033[0m"

struct ftplogin
{
	// login_cmd一条验证命令
	char usr[12];
	char pwd[12];
};

void sighandler(int sig);

int make_tcp_client(const char *ip, unsigned short port);

void showProgressBar(int cnt, int totalFilesize);

void send_command(int sockfd, enum CMD_NO cmd_no, char *arg_1_data, int arg_1_len);

void receive_response(int sockfd, enum CMD_NO command_number, int *recv_size);

void cmd_get(int sockfd, char *filename);

void cmd_get_folder(int sockfd, char *folder_path);

void cmd_put(int sockfd, char *filename);

void cmd_ls(int sockfd);

void cmd_pwd(int sockfd);

void cmd_bye(int sockfd);

// 拓展的
void cmd_rm(int sockfd, char *filename);

void cmd_cd(int sockfd, char *filename);

void cmd_pwd(int sockfd);

int client_login(int sockfd);

#endif
